create-usb: Update summary in destination repo
authorMatthew Leeds <matthew.leeds@endlessm.com>
Mon, 26 Mar 2018 07:01:39 +0000 (00:01 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 19 Apr 2018 13:35:15 +0000 (13:35 +0000)
commitcf7888840130d1fe718c36f2a1155c06ffb90e92
tree8d891f303b850aeb27101236b28dcc8003a46b6e
parent653be1556d56e4d796254e2f89155bcbca840fa9
create-usb: Update summary in destination repo

Currently the create-usb command only generates a summary file in the
destination repo if one doesn't already exist, which means if one does
exist it becomes out of date after the new refs are pulled. This commit
makes ostree regenerate the summary regardless of whether it exists, so
that consumers such as ostree_repo_find_remotes_async() (and at a higher
level, GNOME Software) get an accurate picture of the refs available on
the mount. This commit also updates one of the unit tests to check that
the summary is accurate after a second pull into the same repo.

Since any user of the create-usb command is using collection IDs they
are new enough to be using the unsigned summary support. While it would
technically be possible to use summary signatures on a repo and use the
create-usb command on it (a scenario broken by this commit), the
create-usb command is designed for P2P distribution of refs, which
requires use of unsigned summary support. So this is a legitimate
narrowing of the tool.

Fixes https://github.com/ostreedev/ostree/issues/1465

Closes: #1543
Approved by: cgwalters
src/ostree/ot-builtin-create-usb.c
tests/test-create-usb.sh